﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Summary.master" AutoEventWireup="true"
    CodeFile="Default.aspx.cs" Inherits="School_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="DetailHeaderContent" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="DetailBodyContent" runat="Server">
    <asp:UpdatePanel runat="server" ID="uplMain" UpdateMode="Conditional">
        <ContentTemplate>
            <ajaxToolkit:TabContainer ID="tbcMain" runat="server" ActiveTabIndex="0" Width="880px">
                <ajaxToolkit:TabPanel runat="server" HeaderText="Entity Type" ID="tbcMain_Info">
                    <HeaderTemplate>
                        <img src="../Images/Icons/16/Briefcase-icon.png" class="tab_header_img" title="School Info"
                            alt="Entity" />
                        School Info
                    </HeaderTemplate>
                    <ContentTemplate>
                        <asp:UpdatePanel runat="server" ID="uplEntity" UpdateMode="Conditional">
                            <ContentTemplate>
                                <asp:ValidationSummary ID="vsSummary" ShowSummary="false" runat="server" />
                                <asp:HiddenField ID="hidSchoolID" Value="-1" runat="server" />
                                <asp:Panel runat="server" ID="pnlMain" BackColor="#ffffcc">
                                    <table width="100%" cellpadding="3">
                                        <tr>
                                            <td>
                                                School Name
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtSchoolName" runat="server" Text="" MaxLength="255" Width="450px"></asp:TextBox>
                                                <asp:RequiredFieldValidator CssClass="validationErrorControl" runat="server" ID="rfvSchoolName"
                                                    ControlToValidate="txtSchoolName" ErrorMessage="Require school name." Text=""
                                                    ForeColor="Red" Display="None" ValidationGroup="school" />
                                                <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceSchoolName" TargetControlID="rfvSchoolName"
                                                    HighlightCssClass="validationError" Width="240px" PopupPosition="Right" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                Short Name
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtSchoolShortName" runat="server" Text="" MaxLength="50" Width="212px"></asp:TextBox>
                                                <asp:RequiredFieldValidator CssClass="validationErrorControl" runat="server" ID="rfvSchoolShortName"
                                                    ControlToValidate="txtSchoolShortName" ErrorMessage="Require short name." Text=""
                                                    ForeColor="Red" Display="None" ValidationGroup="school" />
                                                <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceSchoolShortName" TargetControlID="rfvSchoolShortName"
                                                    HighlightCssClass="validationError" PopupPosition="Right" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                Principle Name
                                            </td>
                                            <td class="">
                                                <asp:TextBox ID="txtPrincipleName" Text="" runat="server" MaxLength="200" Width="200px"></asp:TextBox>
                                                <asp:RequiredFieldValidator CssClass="validationErrorControl" runat="server" ID="rfvPrincipleName"
                                                    ControlToValidate="txtPrincipleName" ErrorMessage="Require base grading scale."
                                                    Text="" ForeColor="Red" Display="None" ValidationGroup="school" />
                                                <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vcePrincipleName" TargetControlID="rfvPrincipleName"
                                                    HighlightCssClass="validationError" PopupPosition="Right" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                Email
                                            </td>
                                            <td class="">
                                                <asp:TextBox ID="txtEmail" runat="server" MaxLength="200" Width="200px"></asp:TextBox>
                                                <asp:RegularExpressionValidator CssClass="validationErrorControl" runat="server"
                                                    ID="revEmail" ControlToValidate="txtEmail" ErrorMessage="Invalid email address."
                                                    Text="" ForeColor="Red" Display="None" ValidationGroup="school" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" />
                                                <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceEmail" TargetControlID="revEmail"
                                                    HighlightCssClass="validationError" PopupPosition="Right" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                Full Address
                                            </td>
                                            <td colspan="3">
                                                <asp:TextBox ID="txtAddress" Text="" runat="server" TextMode="MultiLine" MaxLength="255"
                                                    Width="450px"></asp:TextBox>
                                                <asp:RequiredFieldValidator CssClass="validationErrorControl" runat="server" ID="rfvAddress"
                                                    ControlToValidate="txtAddress" ErrorMessage="Require full address." Text="" ForeColor="Red"
                                                    Display="None" ValidationGroup="school" />
                                                <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceAddress" TargetControlID="rfvAddress"
                                                    HighlightCssClass="validationError" PopupPosition="Right" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                City
                                            </td>
                                            <td class="">
                                                <asp:TextBox ID="txtCityName" Text="" runat="server" MaxLength="200" Width="200px"></asp:TextBox>
                                                <asp:RequiredFieldValidator CssClass="validationErrorControl" runat="server" ID="rfvCityName"
                                                    ControlToValidate="txtCityName" ErrorMessage="Require city name." Text="" ForeColor="Red"
                                                    Display="None" ValidationGroup="school" />
                                                <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceCityName" TargetControlID="rfvCityName"
                                                    HighlightCssClass="validationError" PopupPosition="Right" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                State
                                            </td>
                                            <td class="">
                                                <asp:TextBox ID="txtStateName" runat="server" Style="margin-left: 0px" Width="200px"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                Zip/Postal Code
                                            </td>
                                            <td class="">
                                                <asp:TextBox ID="txtPostCode" Text="" runat="server" MaxLength="20" Width="200px"></asp:TextBox>
                                                <asp:RequiredFieldValidator CssClass="validationErrorControl" runat="server" ID="rfvPostCode"
                                                    ControlToValidate="txtPostCode" ErrorMessage="Require zip/postal code." Text=""
                                                    ForeColor="Red" Display="None" ValidationGroup="school" />
                                                <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vcePostCode" TargetControlID="rfvPostCode"
                                                    Width="200px" HighlightCssClass="validationError" PopupPosition="Right" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                Telephone
                                            </td>
                                            <td class="">
                                                <asp:TextBox ID="txtTelephone" runat="server" MaxLength="200" Width="200px"></asp:TextBox>
                                                <asp:RequiredFieldValidator CssClass="validationErrorControl" runat="server" ID="rfvTelephone"
                                                    ControlToValidate="txtTelephone" ErrorMessage="Require telephone." Text="" ForeColor="Red"
                                                    Display="None" ValidationGroup="school" />
                                                <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceTelephone" TargetControlID="rfvTelephone"
                                                    HighlightCssClass="validationError" PopupPosition="Right" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                Base Grading Scale
                                            </td>
                                            <td class="">
                                                <asp:TextBox ID="txtBaseGradingScale" Text="" runat="server" MaxLength="20" Width="200px"></asp:TextBox>
                                                <asp:RequiredFieldValidator CssClass="validationErrorControl" runat="server" ID="rfvBaseGradingScale"
                                                    ControlToValidate="txtBaseGradingScale" ErrorMessage="Require base grading scale."
                                                    Text="" ForeColor="Red" Display="None" ValidationGroup="school" />
                                                <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceBaseGradingScale" TargetControlID="rfvBaseGradingScale"
                                                    HighlightCssClass="validationError" PopupPosition="Right" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                Fax
                                            </td>
                                            <td class="">
                                                <asp:TextBox ID="txtFax" runat="server" MaxLength="200" Width="200px"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                Website Url
                                            </td>
                                            <td class="">
                                                <asp:TextBox ID="txtWebsiteUrl" Text="" runat="server" MaxLength="255" Width="450px"></asp:TextBox>
                                                <asp:RegularExpressionValidator CssClass="validationErrorControl" runat="server"
                                                    ID="revWebsiteUrl" ControlToValidate="txtWebsiteUrl" ErrorMessage="Invalid website url."
                                                    Text="" ForeColor="Red" Display="None" ValidationGroup="school" ValidationExpression="(http(s)?://)?([\w-]+\.)+[\w-]+[.com]+(/[/?%&amp;=]*)?" />
                                                <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vecWebsiteUrl" TargetControlID="revWebsiteUrl"
                                                    HighlightCssClass="validationError" PopupPosition="Right" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">
                                                <asp:Button runat="server" CausesValidation="true" OnClientClick="javascript:alert(isFormChanged(this.form));return false;"
                                                    ValidationGroup="school" CssClass="submitButton" ID="btnSubmit" Text="Save" OnClick="btnSubmit_Click" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">
                                                <asp:Label runat="server" ID="lblMessage" Font-Bold="true" ForeColor="Red" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:DropDownList runat="server" ID="ddlSelect">
                                                    <asp:ListItem Text="1" Value="1" />
                                                    <asp:ListItem Text="2" Value="2" />
                                                </asp:DropDownList>
                                            </td>
                                            <td>
                                                <asp:ListBox runat="server" ID="lstList" SelectionMode="Multiple">
                                                    <asp:ListItem Text="1" Value="1" Selected="True" />
                                                    <asp:ListItem Text="2" Value="2" />
                                                </asp:ListBox>
                                            </td>
                                            <asp:RadioButton ID="rdoRadio1" runat="server" GroupName="radio" Text="1" />
                                            <asp:RadioButton ID="rdoRadio2" runat="server" GroupName="radio" Text="2" />
                                            <br />
                                            <asp:RadioButtonList runat="server" ID="rdoRadioGroup">
                                                <asp:ListItem Text="1" Value="1" />
                                                <asp:ListItem Text="2" Value="2" />
                                            </asp:RadioButtonList>
                                            <br />
                                            <asp:CheckBox ID="chkRadio1" runat="server" Text="1" />
                                            <asp:CheckBox ID="chkRadio2" runat="server" Text="2" />
                                            <br />
                                            <asp:CheckBoxList runat="server" ID="chkRadioGroup">
                                                <asp:ListItem Text="1" Value="1" />
                                                <asp:ListItem Text="2" Value="2" />
                                            </asp:CheckBoxList>
                                        </tr>
                                    </table>
                                </asp:Panel>
                                <ajaxToolkit:RoundedCornersExtender ID="rce" runat="server" TargetControlID="pnlMain"
                                    Radius="10" Corners="All" BorderColor="Gray" />
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </ContentTemplate>
                </ajaxToolkit:TabPanel>
            </ajaxToolkit:TabContainer>
        </ContentTemplate>
    </asp:UpdatePanel>
    <script type="text/javascript">
        function showFormChanged() {
            var oForm = this.form;
            alert(oForm);
        }
    </script>
</asp:Content>
